#include <iostream>
#include <cstdio>
#include "random.cpp"
using namespace std;
int n,m;
int main(){
    init();
    n = randint(1,10),m = randint(1,4);
    printf("%d %d\n",n,m);
    for (int i = 1; i <= n;++i){
        for (int j = 1;j <= m;++j){
            int c = randint(1,2);
            if (c == 1) cout << "P";
            else cout << "H";
        }
        cout << endl;
    }
    return 0;
}